/* eslint-disable no-undef */
import { generateUUID } from "@/utils"
import request from "@/utils/request"
import { HeadersContentType } from "@/utils/request"

import moment from "moment"
let stream = require("stream")

/**
 * @description 附件下载
 */
export function downloadAPI(
  data,
  url = "/download/downLoadMB",
  method = "post"
) {
  return request({
    url,
    method,
    headers: {
      "Content-Type": HeadersContentType.urlencoded
    },
    responseType: "blob",
    params: data
  })
}

/**
 *
 * @description 获取部门
 */
export function getDeparmentTree(data) {
  return request({
    url: "/monster-im/common/dept",
    method: "post",
    headers: {
      "Content-Type": HeadersContentType.json
    },
    data
  })
}

/**
 *
 * @description 获取系统信息
 */
export function getSettingInfo() {
  return request({
    url: "/monster-im/setting",
    method: "get"
  })
}

/**
 *
 * @description 修改系统信息
 */
export function updateSettingInfo(data) {
  return request({
    url: "/monster-im/setting",
    method: "put",
    headers: {
      "Content-Type": HeadersContentType.json
    },
    data
  })
}
